import org.apache.spark.rdd.RDD
import org.apache.spark.sql.SQLContext
import org.apache.spark.{SparkConf, SparkContext}

object RDDtoDF {
  def main(args: Array[String]): Unit = {
    val context = new SparkContext(new SparkConf().setAppName(this.getClass.getSimpleName).setMaster("local[*]"))
    val rdd1: RDD[String] = context.parallelize(List("2","3","4"))
    val sQLContext = new SQLContext(context)
    import sQLContext.implicits._
    rdd1.toDF("ddd")
  }
}
